# Contributor: Galen Abell <galen@galenabell.com>
# Maintainer: Galen Abell <galen@galenabell.com>
pkgname=py3-gls
pkgver=1.3.1
pkgrel=1
pkgdesc="pythonic generic language server"
url="https://github.com/openlawlibrary/pygls"
arch="noarch"
license="Apache-2.0"
depends="py3-lsprotocol py3-cattrs"
makedepends="py3-gpep517 py3-wheel py3-poetry-core"
checkdepends="py3-pytest py3-pytest-asyncio"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/openlawlibrary/pygls/archive/refs/tags/v$pkgver.tar.gz
	"
builddir="$srcdir/pygls-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
ef5d516d2da7e747fafd0a333157a964efcc7bcb424b2171451eb4f4084ada40ea2294cfa2322201b052a10f2958cbf2ea05748fbf7890bc4fbf6d82e154f9d4  py3-gls-1.3.1.tar.gz
"
